#include <stdio.h>  
#include <math.h>  
  
int factorial(int n);  
  
int main(){  
  
    int i=1;  
    double sum=1,t,x,y;  
  
    scanf("%lf", &x);  
  
    do{  
        y=pow(x,i);
        t=y/factorial(i);  
        sum+=t;  
        i++;  
        printf("t = %f, sum = %f\n", t, sum);  
      
    }while(t>=1E-5);  
  
    printf("%.4f\n", sum);  
  
    return 0;  
}  
  int factorial(int n){  
    if(n<=1)  
        return 1;  
    return n*factorial(n-1);  
}  

